<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[Politicians Ranking] MEMBER</title>
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/member.css">
<script src="js/jquery-2.1.1.min.js" type="text/javascript"></script>
<script src="js/common.js" type="text/javascript"></script>
<script src="js/PageInfo.js" type="text/javascript"></script>
<script src="js/member_member.js" type="text/javascript"></script>
<script src="js/member_model.js" type="text/javascript"></script>
<script src="js/member_business.js" type="text/javascript"></script>
<script src="js/member_freeboard.js" type="text/javascript"></script>
<script type="text/javascript">
$( document ).ready(function(e) {
	// 공통 기본 설정
	window.__isClientMode__ = true;	// 클라이언트 모드로 처리
	
	defaultSetting();
	
	// 1. 로그인 처리
	$( 'nav' ).hide();
	$( '.popup' ).hide();
	$( "#login" ).submit( function(event){
		event.preventDefault();
		
		var $form 	= $(this);
		var _id 	= $form.find('input[name="id"]').val();
		var _pass 	= $form.find('input[name="pass"]').val();
		
		login( _id, _pass, function(){ $( 'nav' ).show(); getNotice(); }, null );
	});
	
	$( "#loginForPlatform" ).submit( function(event){
		event.preventDefault();
		
		var $form 		= $(this);
		var _platform 	= $form.find('select[name="platform"]').val();
		var _token 		= $form.find('input[name="token"]').val();
		
		loginForPlatform( _platform, _token, function(){ $( 'nav' ).show(); getNotice(); }, null );
	});
	
	// 공지 내용 가져오기
	function getNotice()
	{
		$.post(	getGatePath()
				,
				{
					__key__: 'selectAllNotices',
					__returnType__: 'json'
				}
				,
				function( data )
				{
					if( data.result == "SUCCESS" )
					{
						
					}else{
						
					}
				}
				,
				'json' );
	}
	
	
	
	// [공통] 팝업 닫기 버튼
	$( ".popup .popupCloseButton" ).bind( "click", function( e )
	{
		$(this).parent().hide();
	});
	
	member_member();
	member_model();
	member_business();
	member_freeboard();
});
</script>
</head>

<body>
    <div id="result">
    </div>
    
	<h1>[Politicians Ranking] 유저 모드</h1>
    <h2>이메일로 로그인하기</h2>
    <form id="login">
        <input type="email" name="id" placeholder="Email" value="bbb@bbb.bbb" />
        <input type="password" name="pass" placeholder="Password" value="1234" />
        <input type="submit" value="Login" />
  	</form>
    <hr/>
    <h2>플랫폼 토큰으로 로그인하기</h2>
    <form id="loginForPlatform">
        <select name="platform" class='selectRegistPlatform'></select>
        <input name="token" type="text" value="VVVV4" />
        <input type="submit" value="Login" />
  	</form>
    <hr/>
    <nav>
    	<h2>MENU</h2>
        <ul>
	        <li><a href="#updateMember" id='myinfo'>내정보 수정</a></li>
	    	<li><a href="#selectModels">정치인 조회</a></li>
            <li><a href="#selectFavoriteModels">즐겨찾기 정치인 조회</a></li>
            <li><a href="#selectCommentModels">댓글남긴 정치인 조회</a></li>
			<li><a href="#selectBusinesses">법안 조회</a></li>
            <li><a href="#selectFavoriteBusinesses">즐겨찾기 법안 조회</a></li>
            <li><a href="#selectCommentBusinesses">댓글남긴 법안 조회</a></li>
            <li><a href="#selectFreeBoard">자유게시판</a></li>
        </ul>
        <hr />
    </nav>
    <div class="viewContainer">
    	<!--회원 업데이트-->
        <div id="updateMember" class="view" >
            <h1>회원정보 수정</h1>
            <form id="updateMemberForm" enctype="text/plain">
            	<div id="memberProfile" class='section'>
                <table>
                    <tr>
                        <td>아이디</td>
                        <td><input name='id' type='text' disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td>닉네임</td>
                        <td><input name='nickname' type='text'/></td>
                    </tr>
                    <tr>
                        <td>성별</td>
                        <td><select name='sex' class='selectSex'></select></td>
                    </tr>
                    <tr>
                        <td>출생일</td>
                        <td><select name='birth' class='selectBirth'></select></td>
                    </tr>
                    <tr>
                        <td>관심 지역</td>
                        <td><select name='region' class='selectRegion'></select></td>
                    </tr>
                    <tr>
                        <td>등록일</td>
                        <td><input name='register' type='text' disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td>계정 권한</td>
                        <td><select name="author" class='selectAuthor' disabled="disabled"></select></td>
                    </tr>
                    <tr>
                        <td>계정 상태</td>
                        <td><select name="status" class='selectStatus' disabled="disabled"></select></td>
                    </tr>
                    <tr>
                        <td>최종 접속일</td>
                        <td><input name='lastlog' type='text' disabled="disabled"/></td>
                    </tr>
                </table>
                </div>
                <input type="submit" value="UPDATE" />
            </form>
        </div>
        
       	<!--정치인 조회-->
        <div id="selectModels" class="view" >
             <h1>정치인 조회</h1>
             <input type='button' class='pageRefreshBtn' id="modelRefresh" value='Refresh'/>
             클라이언트 리스트 <select class='selectMenuList' id="modelSelectByMenu"></select>
             <hr />
             <table class='list'>
             </table>
             <div class='pageNavi'>
                 <input type='button' class='pagePrev' value='Prev'/>
                 <span class='pageLabel'></span>
                 <input type='button' class='pageNext' value='Next'/>
             </div>
        </div>
        
        
       	<!-- 즐겨찾기 정치인 조회-->
        <div id="selectFavoriteModels" class="view" >
             <h1>즐겨찾기 정치인 조회</h1>
             <input type='button' class='pageRefreshBtn' id="favoriteModelRefresh" value='Refresh'/>
             <hr />
             <table class='list'>
             </table>
             <div class='pageNavi'>
                 <input type='button' class='pagePrev' value='Prev'/>
                 <span class='pageLabel'></span>
                 <input type='button' class='pageNext' value='Next'/>
             </div>
        </div>
        
        
       	<!-- 댓글남긴 정치인 조회-->
        <div id="selectCommentModels" class="view" >
             <h1>댓글남긴 정치인 조회</h1>
             <input type='button' class='pageRefreshBtn' id="commentModelRefresh" value='Refresh'/>
             <hr />
             <table class='list'>
             </table>
             <div class='pageNavi'>
                 <input type='button' class='pagePrev' value='Prev'/>
                 <span class='pageLabel'></span>
                 <input type='button' class='pageNext' value='Next'/>
             </div>
        </div>
        
        <!--법안 조회-->
        <div id="selectBusinesses" class="view" >
             <h1>법안 조회</h1>
             <input type='button' class='pageRefreshBtn' id="businessRefresh" value='Refresh'/>
             <hr />
             <table class='list'>
             </table>
             <div class='pageNavi'>
                 <input type='button' class='pagePrev' value='Prev'/>
                 <span class='pageLabel'></span>
                 <input type='button' class='pageNext' value='Next'/>
             </div>
        </div>
        
        <!--법안 조회-->
        <div id="selectFavoriteBusinesses" class="view" >
             <h1>즐겨찾기 법안 조회</h1>
             <input type='button' class='pageRefreshBtn' id="favoriteBusinessRefresh" value='Refresh'/>
             <hr />
             <table class='list'>
             </table>
             <div class='pageNavi'>
                 <input type='button' class='pagePrev' value='Prev'/>
                 <span class='pageLabel'></span>
                 <input type='button' class='pageNext' value='Next'/>
             </div>
        </div>
        
        <!-- 댓글남긴 법안 조회-->
        <div id="selectCommentBusinesses" class="view" >
             <h1>댓글남긴 법안 조회</h1>
             <input type='button' class='pageRefreshBtn' id="commentBusinessRefresh" value='Refresh'/>
             <hr />
             <table class='list'>
             </table>
             <div class='pageNavi'>
                 <input type='button' class='pagePrev' value='Prev'/>
                 <span class='pageLabel'></span>
                 <input type='button' class='pageNext' value='Next'/>
             </div>
        </div>
        
        <!-- 자유 게시판 글 등록 -->
        <div id="selectFreeBoard" class="view">
        	<h1>자유 게시판</h1>
            <input type='button' class='pageRefreshBtn' id="btn_freeBoardRefresh" value='Refresh'/>
        	<hr />
            <table class='list'>
            </table>
            <div class='pageNavi'>
                <input type='button' class='pagePrev' value='Prev'/>
                <span class='pageLabel'></span>
                <input type='button' class='pageNext' value='Next'/>
            </div>
            <hr />
            <div>
            	<input type='button' id="btn_writeFreeBoard" value='쓰기' />
            </div>
        </div>
	</div>
    
    <div class='popupContainer'>
        <!--정치인 업데이트-->
        <div id="updateModel" class="popup" >
            <h1>정치인 상세 보기</h1>
            <input type='button' class='popupCloseButton' value='CLOSE' />
            <div id="modelProfile" class='section'>
				<hr />
                <h2>기본 정보</h2>
                <h3>1. 프로필</h3>
                <table>
            	    <tr>
                        <td>CODE</td>
                        <td><input name='code' type='text' readonly="readonly" class='modelCode'/></td>
                    </tr>
                    <tr>
                        <td>NAME</td>
                        <td><input name='name' type='text' disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td>사진</td>
                        <td><div class="picture" ></div></td>
                    </tr>
                    <tr>
                        <td>출생일</td>
                        <td><input name='birthDate'  type='datetime' placeholder="YYYY.MM.DD" disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td>출생지</td>
                        <td><select name='birthRegion' class='selectRegion' disabled="disabled"></select></td>
                    </tr>
                    <tr>
                        <td>학력</td>
                        <td><select name='education' class='selectEducation' disabled="disabled"></select></td>
                    </tr>
                    <tr>
                        <td>학력 MEMO</td>
                        <td><input name='education_memo' type='text' disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td>성별</td>
                        <td><select name='sex' class='selectSex' disabled="disabled"></select></td>
                    </tr>
                    <tr>
                        <td>군복무</td>
                        <td><select name='military' class='selectMilitary' disabled="disabled"></select></td>
                    </tr>
                    <tr>
                        <td>군복무 MEMO</td>
                        <td><input name='military_memo' type='text' disabled="disabled" /></td>
                    </tr>
                    <tr>
                        <td>키</td>
                        <td><input name='height' type='text' disabled="disabled"/></td>
                    </tr>
                        <td>출처 :</td>
                        <td><input name='ref' type='text' disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td>License :</td>
                        <td><input name='ref_license' type='text' disabled="disabled"/></td>
                    </tr>
                </table>
                <h3>2.기타 썸네일</h3>
                <div class="thumbs"></div>
                <br />
            </div>

            <div id="modelParty" class='section unused'>
            	<hr />
                <h2>정당 히스토리</h2>
                <table class='list'>
                </table>
            </div>
            
            <div id="modelDuty" class='section'>
	            <hr />
                <h2>직책 히스토리</h2>
                <table class='list'>
                </table>
            </div>

            <div id="modelHistory" class='section'>
	            <hr />
                <h2>약력 히스토리</h2>
                <table class='list'>
                </table>
            </div>

            <div id="modelElection" class='section unused'>
            	<hr />
                <h2>당선 히스토리</h2>
                <table class='list'>
                </table>
            </div>

            <div id="modelBusiness" class='section'>
            	<hr />
                <h2>법안 발의</h2>
                <table class='list'>
                </table>
			</div>

            <div id="modelSns" class='section'>
	            <hr />
                <h2>SNS 링크</h2>
                <table class='list'>
				</table>
            </div>
 
            <div id="modelTags" class='section'>
            	<hr />
                <h2>태그</h2>
                <table class='list'>
                </table>
			</div>
             
            <div id="modelStat" class='section'>
            	<hr />
            	<h2>능력치 목록</h2>
                <form id="updateModelStatForm">
                <input name='modelCode' type='hidden' class='modelCode'/>
                <table class='modelStatList'>
                	<thead>
                    	<tr>
                        	<td>능력치 이름</td>
                            <td>평균 값</td>
                            <td>내가 입력한 값( +1 ~ +5 )</td>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <input type='submit' value='저장'/>
           	    </form>
			</div>

            <div id="modelTendency" class='section'>
            	<hr />
                <h2>성향 목록</h2>
                <form id="updateModelTendencyForm">
                <input name='modelCode' type='hidden' class='modelCode'/>
                <table class='modelTendencyList'>
                	<thead>
                    	<tr>
                        	<td>성향 이름</td>
                            <td>평균 값</td>
                            <td>내가 입력한 값( -1 , 0, +1 )</td>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <input type='submit' value='저장'/>
           	    </form>
			</div>

            <div id="modelFavorite" class='section'>
            	<hr />
                <h2>즐겨 찾기</h2>
                <input id='btn_memberFavorite' type='button' value='isFavorite' />
            </div>

            <div id="modelComments" class='section'>
            	<hr />
                <h2>코멘트</h2>
                <input type='button' class='pageRefreshBtn' id="btn_modelCommentRefresh" value='Refresh'/>
                <form id='insertModelCommentForm'>
                	<input name='modelCode' type='hidden' class='modelCode'/>
                    코멘트 입력<input name='comment' type='text'/>
                    <input type='submit' value='저장'/>
                </form>
                <table class="list">
                </table>
                <div class='pageNavi'>
                     <input type='button' class='pagePrev' value='Prev'/>
                     <span class='pageLabel'></span>
                     <input type='button' class='pageNext' value='Next'/>
                </div>
            </div>
        </div>
        
        
        <!--법안 업데이트-->
        <div id="updateBusiness" class="popup" >
            <h1>법안 상세 보기</h1>
            <input type='button' class='popupCloseButton' value='CLOSE' />
            <div id="businessProfile" class='section'>
				<hr />
                <h2>기본 정보</h2>
                <h3>1. 프로필</h3>
                <table>
            	    <tr>
                        <td>CODE</td>
                        <td><input name='code' type='text' readonly="readonly" class='businessCode'/></td>
                    </tr>
                    <tr>
                    	<td>법안 구분 :</td>
                        <td><select name='bCode' class='selectBusiness' disabled="disabled"></select></td>
                    </tr>
                    <tr>
                        <td>법안명 : </td>
                        <td><input name='name' type='text' readonly="readonly"/></td>
                    </tr>
                    <tr>
                        <td>제안 날짜 :</td>
                        <td><input name='pDate'  type='datetime' placeholder="YYYY.MM.DD" disabled="disabled"/></td>
					</tr>
					<tr>
                        <td>결정 날짜 :</td>
                        <td><input name='dDate'  type='datetime' placeholder="YYYY.MM.DD" disabled="disabled"/></td>
                        </tr>
                    <tr>
                        <td>출처 :</td>
                        <td><input name='ref' type='text' disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td>License :</td>
                        <td><input name='ref_license' type='text' disabled="disabled"/></td>
                    </tr>
                </table>
                <h3>2.기타 썸네일</h3>
                <div class="thumbs"></div>
                <br />
   			</div>
            
            <div id="businessLinks" class='section'>
            	<hr />
                <h2>링크</h2>
                <table class='list'>
                </table>
			</div>
             
            <div id="businessTags" class='section'>
            	<hr />
                <h2>태그</h2>
                <table class='list'>
                </table>
			</div>
             
            <div id="businessModels" class='section unused'>
            	<hr />
                <h2>[준비중]관련 정치인</h2>
                <table class='list'>
                </table>
			</div>
            
            <div id="businessFavorite" class='section'>
            	<hr />
                <h2>즐겨 찾기</h2>
                <input id='btn_businessFavorite' type='button' value='isFavorite' />
            </div>
            
            <div id="businessComments" class='section'>
            	<hr />
                <h2>코멘트</h2>
                <input type='button' class='pageRefreshBtn' id="btn_businessCommentRefresh" value='Refresh'/>
                <form id='insertBusinessCommentForm'>
                	<input name='businessCode' type='hidden' class='businessCode'/>
                    코멘트 입력<input name='comment' type='text'/>
                    <input type='submit' value='저장'/>
                </form>
                <table class="list">
                </table>
                <div class='pageNavi'>
                     <input type='button' class='pagePrev' value='Prev'/>
                     <span class='pageLabel'></span>
                     <input type='button' class='pageNext' value='Next'/>
                </div>
            </div>
            
            <div id="businessVote" class='section'>
	            <hr/>
                <h2>찬/반 투표</h2>
                <form id='insertBusinessVoteForm'>
                	<input name='businessCode' type='hidden' class='businessCode'/>
                	의견<select name='vote' class='selectVote'></select>
                    <input type='submit' value='투표하기' />
                </form>
            </div>
        </div>
        
        <!-- 자유게시판 글 조회 -->
        <div id="selectFreeBoardDetail" class="popup">
        	<h1>게시글</h1>
            <input type='button' class='popupCloseButton' value='CLOSE' />
            <hr/>
            <table>
				<tr>
                    <td>제목</td>
                    <td><input name='title' type='text' readonly="readonly"/></td>
                </tr>
                <tr>
                    <td>작성자</td>
                    <td><input name='ownerNickname' type='text' readonly="readonly"/><input name='ownerId' type='hidden' /></td>
                </tr>
                <tr>
                    <td>작성일</td>
                    <td><input name='registDate' type='datetime' readonly="readonly"/></td>
                </tr>
                <tr>
                    <td>내용</td>
                    <td><textarea name='desc' readonly="readonly"></textarea></td>
                </tr>
            </table>
            <div id="freeBoardThumbs" class='section'>
                <hr />
                <h2>첨부 이미지</h2>
                <div class='thumbs'>
                </div>
            </div>
            
            <div id="freeBoardComments" class='section'>
            	<hr />
                <h2>코멘트</h2>
                <input type='button' class='pageRefreshBtn' id="btn_freeBoardCommentRefresh" value='Refresh'/>
                <form id='insertFreeBoardCommentForm'>
                	<input name='boardSeq' type='hidden' class='boardSeq'/>
                    코멘트 입력<input name='comment' type='text'/>
                    <input type='submit' value='저장'/>
                </form>
                <table class="list">
                </table>
                <div class='pageNavi'>
                     <input type='button' class='pagePrev' value='Prev'/>
                     <span class='pageLabel'></span>
                     <input type='button' class='pageNext' value='Next'/>
                </div>
            </div>
        </div>
        
        <!-- 자유게시판 글 쓰기-->
        <div id="insertFreeBoard" class="popup">
        	<h1>자유 게시판 글 쓰기</h1>
            <input type='button' class='popupCloseButton' value='CLOSE' />
            <hr/>
            <form id="insertFreeBoardForm" enctype="multipart/form-data">
                <table>
                    <tr>
                        <td>작성자</td>
                        <td><input name='ownerNickname' type='text' disabled="disabled" /></td>
                    </tr>
                    <tr>
                        <td>제목</td>
                        <td><input name='title' type='text' /></td>
                    </tr>
                    <tr>
                        <td>내용( mysql MEDIUMTEXT )</td>
                        <td><textarea name='desc'></textarea></td>
                    </tr>
                    <tr>
                        <td>첨부이미지 삽입</td>
                        <td><input name='thumbs[]' type='file' multiple="multiple" /></td>
                    </tr>
                </table>
            	<input type='submit' value='저장'/>
            </form>
        </div>
        
        <!-- 자유게시판 글 수정-->
        <div id="updateFreeBoard" class="popup">
        	<h1>자유 게시판 글 수정</h1>
            <input type='button' class='popupCloseButton' value='CLOSE' />
            <hr/>
            <form id="updateFreeBoardForm" enctype="multipart/form-data">
                <table>
                	<tr>
                        <td>SEQ</td>
                        <td><input name='seq' type='text' readonly="readonly"/></td>
                    </tr>
                    <tr>
                        <td>제목</td>
                        <td><input name='title' type='text' /></td>
                    </tr>
                    <tr>
                        <td>작성자</td>
                        <td><input name='ownerNickname' type='text' disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td>작성일</td>
                        <td><input name='registDate' type='datetime' disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td>내용</td>
                        <td><textarea name='desc'></textarea></td>
                    </tr>
                </table>
                <h3>2.기타 썸네일</h3>
                <div id="preThumbs"></div>
                <input name='thumbs[]' type='file' multiple="multiple"/>
                <input type="hidden" name="removeThumbs" />
                <hr/>
            	<input type='submit' value='수정'/>
            </form>
        </div>
    </div>
</body>
</html>
